import axios from "axios";
import { BASE_URL, TIMEOUT, WITH_CREDENTIALS } from "@/common";

/**
 * 创建axios实例
 */
const service = axios.create({
  baseURL: BASE_URL,
  withCredentials: WITH_CREDENTIALS,
  timeout: TIMEOUT
});

/**
 * 请求拦截
 */
service.interceptors.request.use(
  config => {
    return config;
  },
  error => {
    return Promise.reject(error);
  }
);

export default service;
